<template>
    <view class="form-wrap">
        <u-form :model="formData" ref="uForm" :border-bottom="false" :label-width="180" label-align="right">
            <u-form-item label="拍摄地点：" prop="description" :border-bottom="false">
                <FormItemText v-model="formData.description" class="form-wrap_item" />
            </u-form-item>
            <u-form-item label="视频分类：" prop="category" :border-bottom="false">
                <FormItemSelect v-model="formData.category" :list="categoryList" />
            </u-form-item>
            <u-form-item label="拍摄时间：" prop="time" :border-bottom="false">
                <FormItemDateTime v-model="formData.time" class="form-wrap_item" placeholder="请选择 拍摄时间" />
            </u-form-item>
            <u-form-item label="拍摄方向：" prop="direction" :border-bottom="false">
                <FormItemSelect v-model="formData.direction" :list="DIRECTION_LIST" />
            </u-form-item>
            <u-form-item label="拍摄人：" prop="person" :border-bottom="false">
                <FormItemDateTime v-model="formData.person" class="form-wrap_item" placeholder="请选择 起火时间" />
            </u-form-item>
            <u-form-item label="证据来源：" prop="resource" :border-bottom="false">
                <FormItemSelect v-model="formData.resource" :list="resourceList" />
            </u-form-item>
            <u-form-item label="拍摄设备：" prop="device" :border-bottom="false">
                <FormItemText v-model="formData.device" class="form-wrap_item" />
            </u-form-item>
            <u-form-item label="标签：" prop="tag" :border-bottom="false">
                <FormItemSelect v-model="formData.tag" :list="tagList" />
            </u-form-item>
        </u-form>
    </view>
</template>

<script>
import FormItemText from '@/pagesH5/components/Form/formItemText.vue'
import FormItemDateTime from '@/pagesH5/components/Form/formItemDateTime.vue'
import FormItemSelect from '@/pagesH5/components/Form/formItemSelect.vue'

import { DIRECTION_LIST } from '@/const/archives/video.js'
export default {
    components: { FormItemText, FormItemDateTime, FormItemSelect },
    model: {
        prop: 'value',
        event: 'change'
    },
    props: {
        value: {
            type: Object,
            default: () => ({})
        },
    },
    data() {
        return {
            DIRECTION_LIST,
            categoryList: [],
            resourceList: [],
            tagList: [],
        }
    },
    computed: {
        formData: {
            get() {
                return this.value
            },
            set(val) {
                this.$emit('change', val)
            }
        },
    },
    async created() {
        let { dictData: { category, resource, tag } } = this.vuex_basicData
        this.categoryList = category
        this.resourceList = resource
        this.tagList = tag
    }
}
</script>